<?php
require 'init.php';
$admin = $_GET['admin'];
$page = $_GET['page'];
$start = ($page - 1) * 6;
$total = $db -> query("SELECT * FROM `newsInfo` WHERE `isdelete` = '0'");
$total = count($total -> fetch_all(MYSQLI_NUM));
$result = $db -> query("SELECT * FROM `newsInfo` WHERE `isdelete` = '0' LIMIT $start,6");
$result = $result -> fetch_all(MYSQLI_ASSOC);
echo json_encode([
    'total' => $total,
    'data' => $result,
]);
?>